package com.mljr.example.adapter.tab1;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.ctakit.sdk.view.ViewInjector;
import com.ctakit.sdk.view.annotation.ViewInject;
import com.mljr.example.R;
import com.mljr.example.adapter.BaseListAdapter;
import com.mljr.example.bean.tab1.Voucher;

import java.util.List;


/**
 * Created by andyhome on 16/4/20.
 */
public class HeaderOperationAdapter extends BaseListAdapter<Voucher> {

    public HeaderOperationAdapter(Context context) {
        super(context);
    }

    public HeaderOperationAdapter(Context context, List<Voucher> list) {
        super(context, list);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        final ViewHolder holder;
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_operation, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        Voucher entity = getItem(position);



        return convertView;
    }

    static class ViewHolder {
        @ViewInject(R.id.iv_image)
        ImageView ivImage;
        @ViewInject(R.id.tv_title)
        TextView tvTitle;
        @ViewInject(R.id.tv_subtitle)
        TextView tvSubtitle;

        ViewHolder(View view) {
            ViewInjector.inject(this, view);
        }
    }
}
